<!--
 * @Date: 2022-03-17 15:39:18
 * @Author: 陶子
 * @LastEditTime: 2023-07-06 11:30:49
 * @FilePath: \jk_one-stop_pc\src\views\warehouseManagement\inventoryQuery\NewBtn.vue
 * @pageName: 这是--(新建按钮组件)--页面
-->
<template>
  <a-dropdown v-has="'inventoryQuery:add'">
    <a class="ant-dropdown-link" @click="e => e.preventDefault()">
      <a-button type="primary"> +新建 </a-button>
    </a>
    <a-menu slot="overlay">
      <a-menu-item>
        <div class="itemBox" @click="clickOut"><img src="@/assets/img/public-add.png" alt=""> 新建出库单</div>
      </a-menu-item>
      <a-menu-item>
        <div class="itemBox" @click="clickIn"><img src="@/assets/img/public-add.png" alt=""> 新建入库单</div>
      </a-menu-item>
    </a-menu>
  </a-dropdown>
</template>
<script>
export default {
  components: {},
  props: ['cuttentTab'],
  data() {
    return {}
  },
  created() {},
  methods: {
    clickOut() {
      let outObj = {
        cuttentTab: this.cuttentTab,
      }
      this.$emit('addOutStock', outObj)
    },
    clickIn() {
      let inObj = {
        cuttentTab: this.cuttentTab,
      }
      this.$emit('addInStock', inObj)
    },
  },
}
</script> 

<style scoped lang='less'>
.itemBox {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  img {
    width: 16px;
    height: 16px;
    margin-right: 10px;
  }
}
</style>